
<div id="content"">
	
	<h1>Class Ratings</h1>
	
	<div style="margin:0 0px 0 0px;">
		
		<% if(session[:loginrole] != "Admin") %>
			<% form_remote_tag :url => {:controller => "rate", :action =>"submitRatings"} do %>
				<div style="float:left; border:dashed 1px #CCC; padding:9px; width:718px;">
					  <!-- insert code to display prof name here -->
					<table border="0">
					  <tr>
						<td width="580px"><h3>How has <%= @profName %> performed as an instructor?</h3></td>
					  </tr>
					  <tr>
					    <td><%= text_area_tag :performance, @performance, :size => "80x5" %></td>
					  </tr>
					  <tr>
						<td width="580px"><h3>What could be done to improve the class?</h3></td>
					  </tr>
					  <tr>
					    <td><%= text_area_tag :improvement, @improvement , :size => "80x5" %></td>
					  </tr>
					  <tr>
						<td width="580px"><h3>About how many hours did you spend weekly doing work for the class?</h3></td>
					  </tr>
					  <tr>
					    <!-- <td><%= text_area_tag :hours, "Insert hours here", :size => "80x5" %></td> -->
					    <td><%= text_field_tag :hours, @hours %></td>
					  </tr>
					  <tr>
						<td width="580px"><h3>Send these results to <%= @profName %></h3></td>
					  </tr>
					  <tr>
					    <td><%= submit_tag "Submit" %></td>
					  </tr>
					  
					</table>
				</div>
			<% end %>
		<% end %>		
		
		<% if(session[:loginrole] == "Admin") %>
			<div style="float:left;">
				<h3>Ratings entered so far:</h3>
				<%= Rating.showRates %>
			</div>

			<div style="float:right;">
				<h3>Who has rated so far:</h3>
				<%= RatingSubmitted.showRateSubmitteds %>
			</div>
			<div style="clear:both;"></div>
			<p>
			<% form_remote_tag :url => {:controller=>"rate", :action => "Delete_all_rates"} do -%>
				<%= submit_tag "Delete all Rates" %>
			<% end %>
			</p>
		<% end %>
						
	</div>

</div>


